﻿@using VipSoft.CMS.Core.Enum
@using VipSoft.Web.Areas.VipSoft.Controllers
@using VipSoft.WebUtility
@model CategoryDto
@{
    ViewBag.Title = "管理首页";
    Layout = "~/Areas/VipSoft/Views/Shared/_AdminLayout.cshtml";
}
@section Style {

}
<div class="widget-box">
    <div class="widget-header widget-header-small">
        <h5 class="widget-title smaller">@ViewBag.SubTitle</h5>

        <div class="widget-toolbar no-border">
            <ul class="nav nav-tabs" id="myTab">
                <li>
                    <a href="@Url.Action("List", new { cid = @Request.RequestContext.RouteData.Values["cid"], mid = @Request.RequestContext.RouteData.Values["mid"] })">返回</a>
                </li>
            </ul>
        </div>
    </div>
    <div class="widget-body">
        <div class="widget-main padding-6">
            <form id="frmCategory" method="post" class="form-horizontal">
                <div class="tab-content">
                    @if (@Request.RequestContext.RouteData.Values["id"] != null)
                    {
                        <div class="form-group">
                            <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Category.ParentId)</label>
                            <div class="col-sm-11">
                                @Html.DropDownListFor(model => model.Category.ParentId, (SelectList)ViewBag.Category, "请选择", new { @class = "select2 required" })
                            </div>
                        </div>
                    }

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Category.Name)</label>
                        <div class="col-sm-11">
                            @Html.TextBoxFor(model => model.Category.Name, new { @class = "" })
                            @Html.ValidationMessageFor(model => model.Category.Name)
                        </div>
                    </div>
                    @if (Model.IsShowElement(CategoryElement.Thumbnail))
                    {
                        <div class="form-group">
                            <label class="col-sm-1 control-label no-padding-right">@Html.LabelFor(model => model.Category.Thumbnail) </label>
                            <div class="col-sm-11">
                                <div id="swfu_container" style="margin: 3px 10px;">
                                    <div>
                                        <span id="spanButtonPlaceholder"></span>
                                    </div>
                                </div>
                                <div id="thumbnails">
                                    @Html.Raw(ViewBag.Picture)
                                </div>
                            </div>
                        </div>
                    }

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right">@Html.ValidationSummary(true)</label>
                        <div class="col-sm-11">
                            <input type="hidden" id="mid" name="mid" value="@Request.RequestContext.RouteData.Values["mid"]" />
                            <input type="hidden" id="cid" name="ParentId" value="@Request.RequestContext.RouteData.Values["cid"]" />
                            @Html.HiddenFor(model => model.Category.ID)
                            @Html.Hidden("act", Request.QueryString["act"])
                            <input type="submit" name="btnSubmit" value="保存" id="btnSubmit" class="btn btn-info" />
                            &nbsp;&nbsp;&nbsp;&nbsp;<input name="重置" type="reset" class="btn btn-danger" value="重 置" />
                        </div>
                    </div> 
                </div>
            </form>
        </div>
    </div>
</div>
  
@section Script {
    <script src="@Url.Content("~/Scripts/jquery.icheck.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.jpanelmenu.min.js")" type="text/javascript"></script> 

    <script src="@Url.Content("~/Resource/UEditor/third-party/swfupload/swfupload.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/Admin/swfupload.handlers.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery.form.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/Admin/VipSoft.CMS.Category.js")" type="text/javascript"></script>
    <script type="text/javascript">

        //定义mid,cid供VipSoft.CMS.Category.js中的变量使用。
        var mid = @Request.RequestContext.RouteData.Values["mid"];
        var cid = @Request.RequestContext.RouteData.Values["cid"];
    </script>
}
